<?php /* Widget Title: Featured Offer */ ?>

<?php /* Widget Content */ ?>
<div class="featured">
<?php
$deal_pod = new Pod('deal');
$deal_pod->findRecords('RAND()', 1, "t.camp_end >= NOW() && t.dealcheck='1' && t.sale='0' && t.camp_start <= NOW()");
while($deal_pod->fetchRecord()){
	$deal_name = $deal_pod->get_field('name');
	$camp_link = $deal_pod->get_field('camp_link');
	$deal_link = BUZZR_URL.'/deals/'.$camp_link;
	$image = $deal_pod->get_field('image');
    $med_image = wp_get_attachment_image_src($image[0][ID], 'medium', false);
    $med_image = $med_image[0];
    $tags_deal = get_deal_tags($deal_pod);
?>
<a href="<?php echo $deal_link; ?>"><img src="<?php echo $med_image; ?>" alt="<?php echo $tags_deal; ?>" /></a>
<div class="name"><a href="<?php echo $deal_link; ?>"><?php echo $deal_name; ?></a></div>
<?php } ?>
</div>
<?php /* Widget Content */ ?>


<?php
/* Widget Logic */ 
is_home() || is_single() || is_category()|| is_author() || is_tag() || is_page()
/* Widget Logic */ 
?>